package com.flyone.qybackend.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.flyone.qybackend.model.dto.postreply.PostReplyAddRequest;
import com.flyone.qybackend.model.entity.Post;
import com.flyone.qybackend.model.entity.PostReply;
import com.flyone.qybackend.service.PostReplyService;
import com.flyone.qybackend.mapper.PostReplyMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * @author luoyifei
 * @description 针对表【post_reply(帖子收藏)】的数据库操作Service实现
 * @createDate 2023-05-04 13:32:46
 */
@Service
public class PostReplyServiceImpl extends ServiceImpl<PostReplyMapper, PostReply>
        implements PostReplyService {

    @Override
    public boolean savePostReply(PostReplyAddRequest postReplyAddRequest, Long userId) {
        PostReply postReply = new PostReply();
        BeanUtils.copyProperties(postReplyAddRequest, postReply);
        postReply.setUserId(userId);
        return save(postReply);
    }
}




